import QtQuick 2.4

Item {
    id: loading2
    anchors.fill: parent
    property string text: ""
    property bool loading: true
    Text {
        id: textComponent
        anchors.centerIn: parent
        text: parent.text
        color: "#999"
        font.pointSize: 10
    }
    Image {
        id: image
        visible: loading
        width: 1.5 * textComponent.contentHeight
        height: width
        anchors.right: textComponent.left
        anchors.rightMargin: 10
        anchors.verticalCenter: parent.verticalCenter
        source: "qrc:/icon/loading2.svg"
        NumberAnimation {
            target: image
            property: "rotation"
            duration: 1000
            from: 0
            to: 360
            easing.type: Easing.InOutQuad
            loops: Animation.Infinite
            running: loading2.loading
        }
    }
}
